package com.cskaoyan.dbutils.resultsethandler;

import com.cskaoyan.connectionpool.DruidUtils;
import com.cskaoyan.dbutils.Account;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class ResultSetHandlerDemo {

    public static void main(String[] args) throws SQLException {

        // 新建一个queryRUnner对象
        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());


        // 执行查询
        Account account = queryRunner.query("select * from account where id = ?", new MyResultSetHandler(), 2);

        System.out.println(account);


    }
}
